home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 003 / propmgr1.arc / STATEM.ACC < prev    next >
Encoding:
Text File  |  1979-12-31  |  11.5 KB  |  339 lines

  1. * DATE 08/26/84  13:27
  2. * statement module
  3. STOR CHR(PEEK(063)) TO dr
  4. SELE PRIMARY
  5. USE &dr.:account
  6. SET index TO &dr.:account
  7. REST from coname additive
  8. ERAS
  9. STOR t TO more2
  10. DO WHIL more2
  11.  STOR 'Y' TO printer
  12.  STOR 'N' TO disk
  13.  STOR '        ' TO filename
  14.  STOR 0 TO rec:no
  15.  STOR '?' TO comm
  16.  STOR 'N' TO nowprint
  17. TEXT
  18.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  19.  *                                                                           *
  20.  *                                                                           *
  21.  *                                                                           *
  22.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  23.  *                                                                           *
  24.  *                                                                           *
  25.  *                                                                           *
  26.  *                                                                           *
  27.  *                                                                           *
  28.  *                                                                           *
  29.  *                                                                           *
  30.  *                                                                           *
  31.  *                                                                           *
  32.  *                                                                           *
  33.  *                                                                           *
  34.  *                                                                           *
  35.  *                                                                           *
  36.  *                                                                           *
  37.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  38.  *   Please select one of the above options. You may also leave this menu    *
  39.  *   by typing 'Q' and get on-line HELP by typing '?'.                       *
  40.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  41. ENDT
  42.  @ 3,04 SAY coname + ' -  STATEMENT PRINTING MENU'
  43.  @ 3,65 SAY date()
  44.  @ 7,11 SAY "A.  Prepare a new Trial Balance"
  45.  @ 8,11 SAY "B.  Prepare a new Balance Sheet and Profit & Loss Statement"
  46.  @ 9,11 SAY "C.  Print a previously prepared Trial Balance"
  47.  @ 10,11 SAY "D.  Print a previously prepared Balance Sheet and P&L Statement"
  48.  @ 11,11 SAY "E.  Return to main accounting menu"
  49.  @ 13,23 SAY "PLEASE SELECT ONE OF THE OPTIONS"
  50.  @ 13,58 GET comm PICTURE '!'
  51.  READ
  52.  DO WHIL @(COMM, 'ABCDE?Q') = 0
  53.   STOR '?' TO comm
  54.   @ 13,58 GET comm PICTURE '!'
  55.   READ
  56.  ENDD WHILE @(comm)
  57.  DO CASE
  58.  CASE comm = 'A' .OR. comm = 'B'
  59.   STOR DATE() TO stdate
  60.   STOR '12' TO mfyr
  61.   STOR '99' TO build1
  62.   STOR ',' TO bl
  63.   STOR bl TO mcode1
  64.   STOR bl TO mcode2
  65.   STOR bl TO mcode3
  66.   STOR bl TO mcode4
  67.   STOR bl TO mcode5
  68.   STOR bl TO mcode6
  69.   STOR bl TO mcode7
  70.   STOR bl TO mcode8
  71.   STOR bl TO mcode9
  72.   STOR bl TO mcode0
  73.   STOR bl TO mcodea
  74.   STOR 'N' to stub1
  75.   STOR '        ' TO stubdate
  76.   STOR t TO maybe
  77.   @ 13,00 SAY " *****************************************************************************"
  78.   @ 14,00 SAY " *                   What is the statement date ?                            *"
  79.   @ 14,58 GET stdate PICTURE '99/99/99'
  80.   READ
  81.   STOR $(stdate,7,2) + $(stdate,1,2) + $(stdate,4,2) TO stdat
  82.   @ 15,00 SAY " *        What is the ending month of the fiscal or calendar year ?          *"
  83.   @ 15,68 GET mfyr PICTURE '99'
  84.   READ
  85.   IF comm = 'B'
  86.    @ 16,00 SAY " *        Do you want a one month report included ?                          *"
  87.    @ 16,60 GET stub1 PICTURE '!'
  88.    READ
  89.   ENDI comm= 'B'
  90.   IF stub1 = 'Y'
  91.    STOR t TO stub
  92.    STOR bl TO mcode6a
  93.    STOR bl TO mcode7a
  94.    STOR bl TO mcode8a
  95.    STOR bl TO mcode9a
  96.    STOR bl TO mcode0a
  97.    STOR bl TO mcodeaa
  98.    IF $(stdat,3,2) = '01'
  99.     STOR (VAL(stdat) -10000)  TO stdat1
  100.     STOR STR(stdat1,6) TO stdat
  101.     STOR $(stdat,1,2) + '12' + $(stdat,5,2) TO stubdate
  102.    ELSE
  103.     STOR (VAL(stdat) -100) TO stdat1
  104.     STOR STR(stdat1,6) TO stubdate
  105.    ENDI $(stdat)
  106.   ELSE
  107.    STOR f TO stub
  108.   ENDI stub1
  109.   @ 17,00 SAY " *        What building shall we do ('99' for all) ?                         *"
  110.   @ 17,60 GET build1 PICTURE '99'
  111.   READ
  112.   @ 18,00 SAY " *        Do you want to print the statement now ?                           *"
  113.   @ 18,60 GET nowprint PICTURE '!'
  114.   READ
  115.   STOR 1 TO countit
  116.   @ 17,00 SAY " *                                                                           *"
  117.   @ 18,00 SAY " *                                                                           *"
  118.   @ 14,00 SAY " *                                                                           *"
  119.   @ 15,00 SAY " *       This will take a while - so please be patient                       *"
  120.   @ 16,00 SAY " *       I am examining record number.......                                 *"
  121.   @ 16,40 SAY countit
  122.   STOR 0 TO tempamt
  123.   STOR 0 TO tempamt1
  124.   GO top
  125.   STOR $(data,7,4) TO tempcr
  126.   STOR $(data,5,2) TO build
  127.   STOR t TO range
  128.   STOR t TO more
  129.   STOR 1 TO planct
  130.   STOR '10115220321323425530640750856957060A' TO plan
  131.   DO WHIL more
  132. *******************************************************************************
  133. *  NOTE - if you change the ranges in the Chart of Accounts the three         *
  134. *  number groupings in 'plan' may require changing to caculate the statements *
  135. *  'plan' appears again later on under IF STUB                                *
  136. *******************************************************************************
  137.    STOR t TO LOOPING
  138.    DO WHIL looping
  139.     STOR $(plan,planct,3) TO nu
  140.     STOR $(nu,1,2) TO nu1
  141.     STOR $(nu,3,1) TO nu2
  142.     IF range .AND. planct = 19
  143.      STOR # TO rec:no
  144.      STOR f TO range
  145.      STOR tempcr TO tempcr1
  146.     ENDI range
  147.     IF $(tempcr,1,2) = '&nu1'
  148.      DO WHIL $(data,7,2) = '&nu1' .AND. (.NOT. EOF)
  149.       IF (build1 = '99' .OR. build1 = build) .AND. date <= stdat
  150.        STOR $(data,7,4) TO cr
  151.        IF tempcr = cr
  152.         STOR t TO maybe
  153.         STOR tempamt + amount TO tempamt
  154.        ELSE
  155.         STOR STR(tempamt,12,2) TO tempam
  156.         STOR 0 TO tempamt
  157.         STOR 1 TO blank
  158.         DO WHIL $(tempam,blank,1)=' '
  159.          STOR blank+1 TO blank
  160.         ENDD
  161.         STOR $(tempam,blank) TO tempam
  162.         STOR (tempcr +',' + tempam +',') TO mtemp
  163.         STOR (mcode&nu2 + mtemp) TO mcode&nu2
  164.         STOR cr TO tempcr
  165.         STOR f TO maybe
  166.        ENDI tempcr = cr
  167.       ELSE
  168.        SKIP
  169.       ENDI build1
  170.       IF maybe
  171.        SKIP
  172.        STOR countit + 1 TO countit
  173.        @ 16,40 SAY countit
  174.       ENDI maybe
  175.      ENDD WHILE $(data,7,2) = nu2
  176.      STOR STR(tempamt,12,2) TO tempam
  177.      STOR 1 TO blank
  178.      DO WHIL $(tempam,blank,1)=' '
  179.       STOR blank+1 TO blank
  180.      ENDD
  181.      STOR $(tempam,blank) TO tempam
  182.      STOR (tempcr +',' + tempam +',') TO mtemp
  183.      STOR (mcode&nu2 + mtemp) TO mcode&nu2
  184.      STOR $(data,7,4) TO tempcr
  185.      STOR 0 TO tempamt
  186.     ENDI $(tempcr,1,2) = nu1
  187.     STOR planct + 3 TO planct
  188.     IF nu2 = 'A' .OR. EOF
  189.      STOR f TO looping
  190.     ENDI nu2
  191.    ENDD while looping
  192.    IF stub
  193.     GO rec:no
  194.     STOR 0 TO tempamt
  195.     STOR tempcr1 TO tempcr
  196.     STOR 1 TO planct
  197.     STOR '306a407a508a569a570a60Aa' TO plan
  198.     STOR t TO LOOPING
  199.     DO WHIL looping
  200.      STOR $(plan,planct,4) TO nu
  201.      STOR $(nu,1,2) TO nu1
  202.      STOR $(nu,3,2) TO nu2
  203.      IF $(tempcr,1,2) = '&nu1'
  204.       DO WHIL $(data,7,2) = '&nu1' .AND. (.NOT. EOF)
  205.        IF (build1 = '99' .OR. build1 = build) .AND. date <= stdat
  206.         STOR $(data,7,4) TO cr
  207.         IF tempcr = cr
  208.          STOR t TO maybe
  209.          STOR tempamt + amount TO tempamt
  210.         ELSE
  211.          STOR STR(tempamt,12,2) TO tempam
  212.          STOR 0 TO tempamt
  213.          STOR 1 TO blank
  214.          DO WHIL $(tempam,blank,1)=' '
  215.           STOR blank+1 TO blank
  216.          ENDD
  217.          STOR $(tempam,blank) TO tempam
  218.          STOR (tempcr +',' + tempam +',') TO mtemp
  219.          STOR (mcode&nu2 + mtemp) TO mcode&nu2
  220.          STOR cr TO tempcr
  221.          STOR f TO maybe
  222.         ENDI tempcr = cr
  223.        ELSE
  224.         SKIP
  225.        ENDI build1
  226.        IF maybe
  227.         SKIP
  228.         STOR countit + 1 TO countit
  229.         @ 16,40 SAY countit
  230.        ENDI maybe
  231.       ENDD WHILE $(data,7,2) = nu2
  232.       STOR STR(tempamt,12,2) TO tempam
  233.       STOR 1 TO blank
  234.       DO WHIL $(tempam,blank,1)=' '
  235.        STOR blank+1 TO blank
  236.       ENDD
  237.       STOR $(tempam,blank) TO tempam
  238.       STOR (tempcr +',' + tempam +',') TO mtemp
  239.       STOR (mcode&nu2 + mtemp) TO mcode&nu2
  240.       STOR $(data,7,4) TO tempcr
  241.       STOR 0 TO tempamt
  242.      ENDI $(tempcr,1,2) = nu1
  243.      STOR planct + 4 TO planct
  244.      IF $(nu2,1,1) = 'A' .OR. EOF
  245.       STOR f TO looping
  246.      ENDI nu2
  247.     ENDD while looping
  248.    ENDI stub
  249.    STOR f TO more
  250.   ENDD while more
  251.   SELE SECONDARY
  252.   USE &dr.:statemnt
  253.   IF stub
  254.    APPE BLANK
  255.    REPL date WITH stdate, fyr WITH mfyr, bld WITH build1
  256.    REPL code6 WITH mcode6a, code7 WITH mcode7a, code8 WITH mcode8a
  257.    REPL code9 WITH mcode9a, code0 WITH mcode0a, codea WITH mcodeaa
  258.    REPL stubs WITH t
  259.   ENDI stub
  260.   APPE BLANK
  261.   REPL date WITH stdate, fyr WITH mfyr, bld WITH build1
  262.   REPL code1 WITH mcode1, code2 WITH mcode2, code3 WITH mcode3
  263.   REPL code4 WITH mcode4, code5 WITH mcode5, code6 WITH mcode6
  264.   REPL code7 WITH mcode7, code8 WITH mcode8, code9 WITH mcode9
  265.   REPL code0 WITH mcode0, codea WITH mcodea
  266.   IF stub
  267.    REPL stubs WITH t
  268.   ENDI stub
  269.   IF nowprint = 'Y'
  270.    STOR stdate TO daya
  271.    RELE stdate, mfyr, mcode1, mcode2, mcode3, mcode4, mcode5
  272.    RELE mcode6, mcode7, mcode8, mcode9, mcode0,mcodea, bl, maybe, cr
  273.    RELE mcode6a, mcode7a, mcode8a, mcode9a, mcode0a, mcodeaa
  274.    RELE countit, tempcr, blank, tempam, mtemp, more, account
  275.    RELE command, build1, tempamt, stub1
  276.    SAVE TO temp
  277.    CLEA
  278.    REST from temp
  279.    IF comm = 'A'
  280.     STOR 'C' TO com1
  281.    ELSE
  282.     STOR 'D' TO com1
  283.    ENDI comm
  284.    DO statemp.acc
  285.   ELSE
  286.    ERAS
  287.    CLEA
  288.    STOR CHR(PEEK(063)) TO dr
  289.    SELE PRIMARY
  290.    USE &dr.:account
  291.    SET INDEX TO &dr.:account
  292.    REST from coname additive
  293.    STOR t TO more2
  294.   ENDI nowprint
  295.  CASE comm = 'C' .OR. comm = 'D'
  296.   IF comm = 'C'
  297.    STOR 'C' TO com1
  298.   ELSE
  299.    STOR 'D' TO com1
  300.   ENDI comm
  301.   DO statemp.acc
  302.  CASE comm = '?'
  303.   ERAS
  304. TEXT
  305.  
  306.           S T A T E M E N T   P R I N T I N G   H E L P   M E N U
  307.  
  308.     This module calculates a trial balance and an income statement and
  309.     a balance sheet.  It will also prepare a one month 'stub' income
  310.     statement.
  311.  
  312.     You can print the statement at the time of the calculation, or at
  313.     any later time. It will always print the last statement prepared
  314.     under a particular date.  If you initially asked for the stub 
  315.     statement, it will always print the stub statement in addition to
  316.     the full statement.
  317.  
  318.     If you elect to print the statement, you can send it to both the
  319.     screen and the printer or just the screen.  You can also send the
  320.     output to a disk file where you can edit it further before printing.
  321.  
  322.     It will take a few minutes for the calculations, so please be patient
  323.     while it runs.
  324.  
  325.  
  326.                     Please hit any key to return to the menu
  327. ENDT
  328.   SET CONSOLE OFF
  329.   WAIT
  330.   SET CONSOLE ON
  331.   ERAS
  332.   STOR t TO more2
  333.  CASE comm = 'E' .OR. comm = 'Q'
  334.   STOR f TO more2
  335.  ENDC
  336. ENDD WHILE more2
  337. RELE ALL
  338. STOR t TO account
  339.